package org.nipe.pomodoro;

public class Pomodoro {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int minWork = 25;
		int minPause = 5;
		if (args.length > 0 && args[0] != null)
			minWork = Integer.parseInt(args[0]);
		if (args.length > 1 && args[1] != null)
			minPause = Integer.parseInt(args[1]);

		int pomodoroNr = 1;
		System.out.println("Pomodoro session  started " + minWork
				+ " minutes of work and " + minPause + " minutes of pause.");
		while (true) {
			System.out.println("Pomodoro nr." + pomodoroNr + " started "
					+ minWork + " minutes of good work.");
			for (int i = 0; i < minWork; i++) {
				try {
					System.out.print("#");
					Thread.sleep(1000 * 60);
				} catch (InterruptedException e) {
					System.out.println("Pomodoro " + pomodoroNr + " ended.");
				}

			}
			System.out.println("Pause nr." + pomodoroNr + " started "
					+ minPause + " minutes of good relax.");
			for (int i = 0; i < minPause; i++) {
				try {
					System.out.print("#");
					Thread.sleep(1000 * 60);
				} catch (InterruptedException e) {
					System.out.println("Pause " + pomodoroNr + " ended.");
					pomodoroNr++;
				}

			}
		}

	}

}
